// js是单线程语言
function a() {
    return new Promise((resolve,reject) => {
        setTimeout(() => {
            resolve('1')
            console.log('aaa');
        },2000)
})
}
function b() {
    return new Promise((resolve,reject) => {
        setTimeout(() => {
            resolve('2')
            console.log('bbb');
        },1000)  
})
}
function c() {
    setTimeout(() => {
        console.log('ccc');
    },500)
}
// a().then(b).then(c)
Promise.all([a(),b()]).then(c) //bac all(b<a,b先a后)，然后c
// Promise.race([a(),b()]).then(c) //bca race(b<a,b先)，然后c，然后a